-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Support float32, float64, and array type query params #2297
feat: Support float32, float64, and array type query params #2297
Conversation
Also fixes a bug with float32 lists where it was incorrectly converted to List<Double> where we expect List<Float> Change-Id: I4d4b32dcddef74711eeea8997b020c46eee8be3c
private static ArrayValue arrayValueOf(List<?> value, SqlType.Array<?> arrayType) { | ||
ArrayValue.Builder valueBuilder = ArrayValue.newBuilder(); | ||
for (Object element : value) { | ||
if (element == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be of a nullValueWithType
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the API only wants the type set on the outermost value, not nested elements
break; | ||
case FLOAT64: | ||
Double doubleElem = (Double) element; | ||
valueBuilder.addValues(Value.newBuilder().setFloatValue(doubleElem).build()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we float64ParamOf(doubleElm)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, because we don't want to set type on the nested elements
LGTM |
🤖 I have created a release *beep* *boop* --- ## [2.42.0](https://togithub.com/googleapis/java-bigtable/compare/v2.41.0...v2.42.0) (2024-08-06) ### Features * Support float32, float64, and array type query params ([#2297](https://togithub.com/googleapis/java-bigtable/issues/2297)) ([a65640e](https://togithub.com/googleapis/java-bigtable/commit/a65640e285950d02136544bac913b2852cfe0274)) ### Bug Fixes * Adapt toString tests to introduction of java.time in gax ([93f66a7](https://togithub.com/googleapis/java-bigtable/commit/93f66a70371f8095fd5c001a977d71e5622be46d)) ### Dependencies * Update shared dependencies ([93f66a7](https://togithub.com/googleapis/java-bigtable/commit/93f66a70371f8095fd5c001a977d71e5622be46d)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
Also fixes a bug with float32 lists where it was incorrectly converted to List of Double where we expect List of Float
Change-Id: I4d4b32dcddef74711eeea8997b020c46eee8be3c
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> ☕️
If you write sample code, please follow the samples format.